package a.student.library;

import a.student.library.BaseDto;
import android.database.Cursor;

public class Class extends BaseDto{
	public int id;
	public String className;
	public String type;
	public String courseID;
	public String location;
	public String timeStart;
	public String timeEnd;
	public String repeat;
	public String dateRepeat;
	public String dateStart;
	public String dateEnd;
	public String instructorID;
	public String instructorName;
	public int assCount;
	
//	Class_Name,Type,C_ID,CT_ID,Location,Date_Start,Date_End,Time_Start,Time_End,Repeat,Day_repeat
	
	public static final String CLASS_NAME = "Class_Name";
	public static final String CLASS_TYPE = "Type";
	public static final String CLASS_ID = "CL_ID";
	public static final String CLASS_CID = "C_ID";
	public static final String CLASS_CTID = "CT_ID";
	public static final String CLASS_LOCATION = "Location";
	public static final String CLASS_DATESTART = "Date_Start";
	public static final String CLASS_DATEEND = "Date_End";
	public static final String CLASS_TIMESTART = "Time_Start";
	public static final String CLASS_TIMEEND = "Time_End";
	public static final String CLASS_REPEAT = "Repeat";
	public static final String CLASS_DATEREPEAT = "Day_repeat";
	
	public static final String CLASS_TBLNAME = "Class";
	public static final String CLASS_DEFAULT_SORT_ORDER = CLASS_ID + " ASC";
	public Class(String[] data){
		this.id = Integer.valueOf(data[0]);
		this.className = data[1];
		this.type = data[2];
		this.location = data[3];
		this.timeStart = data[4];
		this.timeEnd = data[5];
		this.repeat = data[6];
		this.dateRepeat = data[7];
	}

	public Class(int id,String className,String type,String location,String timeStart,String timeEnd,String repeat,String dateRepeat,String dateStart,int assCount){
		this.id = id;
		this.className = className;
		this.type = type;
		this.location = location;
		this.timeStart = timeStart;
		this.timeEnd = timeEnd;
		this.repeat = repeat;
		this.dateRepeat = dateRepeat;
		this.dateStart = dateStart;
		this.assCount = assCount;
	}
	
	public Class(int id,String className,String type,String courseID,String location,String timeStart,String timeEnd,String repeat,String dateRepeat,String instructorID,int assCount){
		this.id = id;
		this.className = className;
		this.type = type;
		this.courseID = courseID;
		this.location = location;
		this.timeStart = timeStart;
		this.timeEnd = timeEnd;
		this.repeat = repeat;
		this.dateRepeat = dateRepeat;
		this.instructorID = instructorID;
		this.assCount = assCount;
	}
	public Class(String className,String type,String courseID,String location,String dateStart,String dateEnd,String timeStart,String timeEnd,String repeat,String dateRepeat){
		this.className = className;
		this.type = type;
		this.courseID = courseID;
		this.location = location;
		this.timeStart = timeStart;
		this.timeEnd = timeEnd;
		this.repeat = repeat;
		this.dateRepeat = dateRepeat;
		this.dateStart = dateStart;
		this.dateEnd = dateEnd;
	}
	public Class(int id,String className,String type,String courseID,String location,String dateStart,String dateEnd,String timeStart,String timeEnd,String repeat,String dateRepeat,String instructorID,String instructorName,int assCount){
		this.id = id;
		this.className = className;
		this.type = type;
		this.courseID = courseID;
		this.location = location;
		this.timeStart = timeStart;
		this.timeEnd = timeEnd;
		this.repeat = repeat;
		this.dateRepeat = dateRepeat;
		this.instructorID = instructorID;
		this.dateStart = dateStart;
		this.dateEnd = dateEnd;
		this.instructorName = instructorName;
		this.assCount = assCount;
	}
	
	public Class(Cursor c){
		super();
		this.id = c.getInt(c.getColumnIndex(CLASS_ID));
		this.className = c.getString(c.getColumnIndex(CLASS_NAME));
		this.type = c.getString(c.getColumnIndex(CLASS_TYPE));
		this.courseID = c.getString(c.getColumnIndex(CLASS_CID));
		this.location = c.getString(c.getColumnIndex(CLASS_LOCATION));
		this.timeStart = c.getString(c.getColumnIndex(CLASS_TIMESTART));
		this.timeEnd = c.getString(c.getColumnIndex(CLASS_TIMEEND));
		this.repeat = c.getString(c.getColumnIndex(CLASS_REPEAT));
		this.dateRepeat = c.getString(c.getColumnIndex(CLASS_DATEREPEAT));
		this.instructorID = c.getString(c.getColumnIndex(CLASS_CTID));
		this.dateStart = c.getString(c.getColumnIndex(CLASS_DATESTART));
		this.dateEnd = c.getString(c.getColumnIndex(CLASS_DATEEND));
//		this.instructorName = instructorName;
//		this.assCount = assCount;
	}
	
	public Class(String repeat, String dateRepeat, String dateStart,
			String dateEnd) {
		this.repeat = repeat;
		this.dateRepeat = dateRepeat;
		this.dateStart = dateStart;
		this.dateEnd = dateEnd;
	}
	
	public int getClassId() {
		return id;
	}
	public void setClassId(int id) {
		this.id = id;
	}
}
